using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace bookmeetingroom.Data.Entities
{
    public class Booking : EntityBase
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [ForeignKey("User")]
        [Required]
        public int UserId { get; set; }
        public ApplicationUser User { get; set; }

        [ForeignKey("MeetingRoom")]
        [Required]
        public int MeetingRoomId { get; set; }
        public MeetingRoom MeetingRoom { get; set; }

    
        public List<BookingResult> BookingResults { get; set; }

        public Guid CompanyId { get; set; }


        [Display(Name = "预定时间")]
        [Required(ErrorMessage = "预定时间不能为空")]
        public DateTime BookDate { get; set; }



        [Display(Name = "开始时间")]
        [Required(ErrorMessage = "开始时间不能为空")]
        public DateTime StartTime { get; set; }


        [Display(Name = "结束时间")]
        [Required(ErrorMessage = "结束时间不能为空")]
        public DateTime EndTime { get; set; }


        [StringLength(200)]
        [Display(Name = "标识")]
        public string Label { get; set; }


        [StringLength(400)]
        [Display(Name = "备注")]
        public string Note { get; set; }


        [Display(Name = "重复类型")]
        public int RepeatType { get; set; }//1:dialy,2:weekly,3:monthly


        [Display(Name = "重复次数")]
        public int RepeatTimes { get; set; }

        [StringLength(800)]
        [Display(Name = "相关人邮件")]
        public string StakeholderEmails { get; set; }

        [StringLength(200)]
        [Display(Name = "邮件主题")]
        public string EmailSubject { get; set; }

        [StringLength(1000)]
        [Display(Name = "邮件正文")]
        public string EmailBody { get; set; }

        [Display(Name = "附件")]
        public byte[] Attached { get; set; }

        public int Status { get; set; }



    }
}